package com.maogouxiong.seatateststorage.storage.controller;


import com.maogouxiong.seatateststorage.storage.entity.Storage;
import com.maogouxiong.seatateststorage.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author maogouxiong
 * @since 2020-06-19
 */
@RestController
@RequestMapping("/storage/storage")
public class StorageController {

    @Autowired
    private StorageService storageService;

    @RequestMapping(value = "/reduceStorage")
    public void reduceStorage (int count, String commodityCode) {
        Storage storage = new Storage();
        storage.setCount(count);
        storage.setCommodityCode(commodityCode);
        storageService.reduceStorage(storage);
    }
}
